//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//   PACKAGE : dcf
//   FILE    : DisconnectMessage.java
//   CLASS   : DisconnectMessage
//   DATE    : 2006-04-01
//   
//   DESCRIPTION
//   The DisconnectMessage class is a message used to indicate that a service is no has been bound to an 
//   endpoint. This message is a system-level message and not intended for general consumption.
//   
//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//   Copyright (c) 2006 by Hal Smith
//
//   Permission is hereby granted, free of charge, to any person obtaining a copy of this source code 
//   (the "Code")to deal with the Code without restriction, including without limitation the rights to use, copy,
//   modify, merge, publish and distribute the Code, and to permit persons to whom the Code is furnished to do 
//   so, subject to the following conditions:
//
//   The above copyright notice and this permission notice shall be included in all copies or substantial 
//   portions of the Software.
//   
//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//   VERSION HISTORY
//
//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

package dcf;


class DisconnectMessage extends Message {
	
	// The service name and endpoint of the service to be disconnected.
	//
	private String   serviceName;
	private Endpoint endpoint;
	
	
	// Constructor.
	//
	// This operation initializes the DisconnectMessage with the name of the service and the endpoint to be 
	// disconnected. If the supplied endpoint or service name is null the operation will log an error and 
	// throw an InitializationException. There are no exceptions thrown by this operation.
	//
	public DisconnectMessage (Endpoint initEndpoint, String initServiceName) throws InitializationException {

		// If either of the supplied parameters are null, log an error and throw an InitializationException.
		// Otherwise, save off the necessary data locally.
		//
		if (initEndpoint    == null || 
			initServiceName == null ) {
			
			System.out.println("DisconnectMessage.DisconnectMessage(initEndpoint, initServiceName):");
			System.out.println("   Both parameters must be non-null.");			
			System.out.println("   Endpoint parameter null?     " + (initEndpoint    == null));			
			System.out.println("   Service name parameter null? " + (initServiceName ==null));	
			
			throw new InitializationException();
			
		} else {
			
			serviceName = initServiceName;
			endpoint    = initEndpoint;			
			
		}
	
	} // constructor
	

	// This operation returns the service name of the service being disconnected. There are no exceptions
	// thrown by this operation.
	//
	public String getServiceName() {
		
		return serviceName;
	
	} // getServiceName()
	
	
	// This operation returns the endpoint of the service being disconnected. There are no exceptions thrown
	// by this operation.
	//
	public Endpoint getEndpoint() {
	
		return endpoint;
	
	} // getEndpoint()

	
} // DisconnectMessage
